<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "goods".
 *
 * @property int $id
 * @property string $goodsid SKU
 * @property string $goodsno 货品编号
 * @property int $gys 供应商
 * @property int $nextid 运营id
 * @property string $goodsname 商品名称
 * @property int $class 类别
 * @property string $createtime 上传时间
 * @property string $updatetime 更新时间
 * @property double $inprice 进货价
 * @property double $lastprice 上次价格
 * @property double $upfee 上涨幅度
 * @property string $remark 备注
 * @property int $check 审核状态
 * @property bool $export 是否导出
 * @property int $priceunit 币种
 * @property string $progress 审核进度
 */
class Goods extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'goods';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['goodsid', 'goodsno', 'gys', 'nextid', 'goodsname', 'class', 'createtime', 'inprice'], 'required'],
            [['gys', 'nextid', 'class', 'check', 'priceunit'], 'integer'],
            [['createtime', 'updatetime'], 'safe'],
            [['inprice', 'lastprice', 'upfee'], 'number'],
            [['remark', 'progress'], 'string'],
            [['export'], 'boolean'],
            [['goodsid', 'goodsno'], 'string', 'max' => 20],
            [['goodsname'], 'string', 'max' => 200],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'goodsid' => 'SKU',
            'goodsno' => '货品编号',
            'gys' => '供应商',
            'nextid' => '运营id',
            'goodsname' => '品名',
            'class' => '类别',
            'createtime' => '上传时间',
            'updatetime' => '更新时间',
            'inprice' => '进货价',
            'lastprice' => '上次价格',
            'upfee' => '上涨幅度',
            'remark' => '备注',
            'check' => '审核状态',
            'export' => '是否导出',
            'priceunit' => '币种',
            'progress' => '审核进度',
        ];
    }
}
